package com.taiji.dicom4cloud.smart.alarm.socket;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Description
 * @Author fanxl
 * @Date 2021/8/13
 **/
@Data
@PropertySource("classpath:socket.properties")
public class ServerSocketConfig implements InitializingBean {

    private ExecutorService threadPool = Executors.newCachedThreadPool();



    @Override
    public void afterPropertiesSet() throws Exception {
        threadPool.submit(new ServerSocketBean());
    }
}
